package niuke.test;

import java.util.ArrayList;
import java.util.Scanner;

/**
 输入
 5
 picture
 turepic
 icturep
 word
 ordw
 输出
 2
 */
public class CycleWord {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        ArrayList<String> list = new ArrayList<>();

        boolean flag =true;

        for (int i = 0; i < n; i++) {
            String word = sc.next();

            if(list.isEmpty()){
                list.add(word+word);
            }else {
                for (String s : list) {
                    if(s.contains(word) && s.length()==word.length()*2){
                        flag = false;
                        break;
                    }
                        flag = true;
                }
                if(flag){
                    list.add(word+word);
                    flag = true;
                }
            }
        }
        System.out.println(list.size());
//        for (String s : list) {
//            System.out.println(s);
//
//        }
    }
}